public class demo34 {
    //只出现一次的数字（位运算）按位异或
    class Solution {
        public int singleNumber(int[] nums) {
            int num = 0;
            for(int n : nums)
            {
                num ^=n;
            }
            return num;
        }
    }
}
